package o;

import android.app.Activity;
import android.content.Intent;
import android.text.TextUtils;
import java.util.HashMap;
import java.util.Map;

public class dys {
    private static Map<String, Class<? extends dyr>> ˊ = new HashMap();
    private static e ˋ;
    private static String ॱ;

    public interface a {
        void finish();

        Intent getIntent();

        void setResult(int i);

        void setResult(int i, Intent intent);

        void startActivity(Intent intent);

        void startActivityForResult(Intent intent, int i);

        Activity ˊ();

        void ˊ(String str);

        void ˋ(cjm o_cjm, int i);

        void ˎ(cjm o_cjm, int i);

        String ˏ();

        void ˏ(fjb o_fjb, Intent intent);

        void ॱ(com.huawei.appmarket.service.externalapi.view.ThirdApiActivity.a aVar);
    }

    public interface e {
        void ˎ(Intent intent, dyr o_dyr);

        void ॱ(Intent intent, dyr o_dyr);
    }

    public static void ˋ(String str, Class<? extends dyr> cls) {
        ˊ.put(str, cls);
    }

    public static void ˏ(String str) {
        ॱ = str;
    }

    public static e ˊ() {
        return ˋ;
    }

    public static void ˊ(e eVar) {
        ˋ = eVar;
    }

    public static dyr ˋ(a aVar) {
        if (aVar == null) {
            return null;
        }
        Intent intent = aVar.getIntent();
        if (intent == null) {
            return null;
        }
        String str;
        CharSequence action = intent.getAction();
        if (!TextUtils.isEmpty(action)) {
            CharSequence charSequence = action;
        } else if (TextUtils.isEmpty(ॱ)) {
            return null;
        } else {
            str = ॱ;
        }
        Class cls = (Class) ˊ.get(str);
        if (cls == null) {
            return null;
        }
        try {
            dyr o_dyr = (dyr) cls.getConstructor(new Class[]{a.class}).newInstance(new Object[]{aVar});
            o_dyr.setActionName(str);
            return o_dyr;
        } catch (Throwable e) {
            Logger.ˋ("ExternalActionRegistry", "init Action failed!", e);
            return null;
        } catch (Throwable e2) {
            Logger.ˋ("ExternalActionRegistry", "init Action failed!", e2);
            return null;
        } catch (Throwable e22) {
            Logger.ˋ("ExternalActionRegistry", "init Action failed!", e22);
            return null;
        } catch (Throwable e222) {
            Logger.ˋ("ExternalActionRegistry", "init Action failed!", e222);
            return null;
        } catch (Throwable e2222) {
            Logger.ˋ("ExternalActionRegistry", "init Action failed!", e2222);
            return null;
        }
    }
}
